home *** CD-ROM | disk | FTP | other *** search
/ SunSoft Catalyst CDWARE 1996 May to August / Catalyst CDWARE 1996 May to August.iso / .products / .bin / prod.nawk < prev    next >
Text File  |  1995-11-29  |  1KB  |  29 lines

  1.         BEGIN {i=65;s=0;lowcase ="^a.*";letter ="^A.*";rletter = "A"} {
  2.         orig=$1
  3.         if ( $1 ~ /^[0-9]/ ) { 
  4.         gsub(/^[0-9]/,"A",$1)
  5.         }
  6.         if ( $1 ~ "The" ) { 
  7.         gsub(/The /,"",$1)
  8.         }
  9.         comp = $1
  10.         if ( comp !~ letter && comp !~ lowcase ) {
  11.                 for ( x=i;x<=100; ++x ){
  12.                 l = (x + 32)
  13.                 letter = sprintf("^%c.*", x)
  14.                 lowcase = sprintf("^%c.*", l)
  15.                 rletter = sprintf("%c", x)
  16.                 if ( comp ~ letter || comp ~ lowcase ) {i=x;s=0;break}
  17.                 }
  18.         }
  19.         if ( (comp ~ letter || comp ~ lowcase ) && s==0 ) {
  20.         printf ("<DT><A NAME=\""rletter"\"><B><B>"rletter"</B></B></A><DD><a href=file:///tmp/httpd/.products/"$2"/index.html><B>"orig"</B></a><i> from </i><b>"$3"</b>")
  21.         print "<br>" ;s=2 
  22.         }
  23.         if ( (comp ~ letter || comp ~ lowcase) && s==1) {
  24.         print "     <DD><a href=file:///tmp/httpd/.products/"$2"/index.html><B>"orig"</B></a><i> from </i><b>"$3"</b>"
  25.         print "<br>" 
  26.         }
  27.         s=1
  28.         }
  29.